public class AgriculturalMachineContext {
    private AgriculturalMachine machine;
    private MachineState currentState;

    public AgriculturalMachineContext(AgriculturalMachine machine) {
        this.machine = machine;
        this.currentState = new IdleState(); // 初始状态为空闲
    }

    public void setState(MachineState state) {
        this.currentState = state;
        currentState.handleState();
    }

    public MachineState getState() {
        return currentState;
    }

    public AgriculturalMachine getMachine() {
        return machine;
    }
}